<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./jsue.js"></script>
</head>

<body>
    <div id="app">
        一个乐高玩具在日本的价格是：{{price}}，含税价格是:{{price1}}，转为人民币的价格是:{{price2}}
        <button @click="abc(1000)">加价1000<tton>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                price:2000,
                price1:0,
                price2:0,
            },
            methods:{
                abc(newprice){
                    this.price +=newprice;
                }
            },
            watch:{
                //被监听的属性
                price(newval,oldval){
                    this.price1=this.price*1.08;
                    this.price2=this.price/16.75
                }
            }  
            
        })
    </script>
</body>

<ml>